home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / lib / partman / check.d / 08mountpoint_fat < prev    next >
Text File  |  2008-10-29  |  1KB  |  46 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4.  
  5. for dev in $DEVICES/*; do
  6.     [ -d "$dev" ] || continue
  7.     cd $dev
  8.     partitions=
  9.     open_dialog PARTITIONS
  10.     while { read_line num id size type fs path name; [ "$id" ]; }; do
  11.         [ "$fs" != free ] || continue
  12.         partitions="$partitions $id,$num"
  13.     done
  14.     close_dialog
  15.  
  16.     for part in $partitions; do
  17.         id=${part%,*}
  18.         num=${part#*,}
  19.         [ -f $id/method ] || continue
  20.         [ -f $id/acting_filesystem ] || continue
  21.         filesystem=$(cat $id/acting_filesystem)
  22.         case $filesystem in
  23.             fat16|fat32|ntfs)
  24.             [ -f "$id/mountpoint" ] || continue
  25.             mountpoint="$(cat "$id/mountpoint")"
  26.             # Check for FAT file systems mounted in places where POSIX
  27.             # filesystem semantics are usually expected, and make the
  28.             # user choose again.
  29.             case $mountpoint in
  30.                 /|/boot|/home|/opt|/srv|/tmp|/usr|/usr/local|/var)
  31.                 >"$id/visual_mountpoint"
  32.                 db_subst partman-basicfilesystems/posix_filesystem_required FILESYSTEM "$filesystem"
  33.                 db_subst partman-basicfilesystems/posix_filesystem_required MOUNTPOINT "$mountpoint"
  34.                 db_metaget partman/filesystem_short/ext2 description || RET=
  35.                 [ "$RET" ] || RET=ext2
  36.                 db_subst partman-basicfilesystems/posix_filesystem_required EXT2 "$RET"
  37.                 db_input critical partman-basicfilesystems/posix_filesystem_required || true
  38.                 db_go || true
  39.                 exit 1
  40.                 ;;
  41.             esac
  42.             ;;
  43.         esac
  44.     done
  45. done
  46.